"""
"The contents of this file are subject to the Mozilla Public License
Version 1.1 (the "License"); you may not use this file except in
compliance with the License. You may obtain a copy of the License at
http://www.mozilla.org/MPL/

Software distributed under the License is distributed on an "AS IS"
basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the
License for the specific language governing rights and limitations
under the License.

The Original Code is rpg-textengine (http://code.google.com/p/rpg-textengine/).

The Initial Developer of the Original Code is Devin Jeanpierre (jeanpierreda@gmail.com).

Contributor(s): 
(none)
."
"""
#This is the "special moves" section
#These are all special functions of  playerstats, listofenemies, and speclist (The list of special attacks)
#This means they can add status effects like poison, as well as modify any attributes.
import Core
import random
#Move descriptions are found in the DOSCTRING, accessible via function.func_doc
def Sacrifice( playerstats, enemylist, speclist):
    """The Spell of Sacrifice. Handed from the God of Forgiveness, you may destroy your enemies, at the cost of your livelyhood."""
    print "you declare:"
    print "\"I summon the God of Forgiveness, to extract my being, for the purpose of Destroying my enemies\""
    print "you take %s damage" % str(.5*playerstats.HP[0])
    playerstats.HP[0] = .5*playerstats.HP[0]
    for enemy in enemylist:
        enemy.HP[0] = .4*enemy.HP[0]
        print "%s takes %s damage" % (enemy.Name, str(.4*enemy.HP[0]))

def Grenade( playerstats, enemylist, speclist):
    """Grenades. You can lob them and hurt many opponents at the same time."""
    if playerstats.TP[0] - 5 < 0: print "Not enough TP. You reach for the grenade, but miss."
    else:
        print "You quickly grab a grenade from your pack, and throw it."
        number = 5
        for enemy in enemylist:
            if number <= 0: break
            damage = random.randint(number, 10)
            print "The grenade deals %s damage to %s" % (str(enemy.retDEF(damage)), enemy.Name )
            enemy.DEF(damage)
        print "You lose %s TP" % str(5) 
        playerstats.TP[0] = playerstats.TP[0] - 5
    
    
        
    